<template>
  <Dialog v-model="dialogVisible" :title="dialogTitle" width="65%" scroll>
    <Tenant @success="close" />
  </Dialog>
</template>
<script lang="ts" setup>
defineOptions({ name: 'TenantSelect' })
const Tenant = defineAsyncComponent(() => import('./TenantList.vue'))
const { t } = useI18n() // 国际化

const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref(t('common.switchTenant')) // 弹窗的标题
const open = async () => {
  dialogVisible.value = true
}
const close = async () => {
  dialogVisible.value = false
}
defineExpose({ open }) // 提供 open 方法，用于打开弹窗
</script>
